import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int nums = 0;
        int factor = 0;
        nums = sc.nextInt();
        for (int i = 1; i <= nums; i++) {
            if (pernumjudge(i)) {
                System.out.println(i);
            }
        }
    }
    public static boolean pernumjudge(int num) {
        int ret = 0;
        for (int i = 1; i <= num / 2; i++) {
            if(num % i == 0) {
                ret += i;
            }
        }
        if(ret == num) {
            return true;
        } else {
            return false;
        }
    }
}



